# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=deblaze
pkgver=1.0608dc3
pkgrel=4
epoch=1
groups=('blackarch' 'blackarch-scanner')
pkgdesc='Performs method enumeration and interrogation against flash remoting end points.'
url='https://github.com/SpiderLabs/deblaze'
arch=('any')
license=('GPL3')
depends=('python2' 'python2-pillow6')
makedepends=('git')
source=("git+https://github.com/SpiderLabs/$pkgname.git")
sha512sums=('SKIP')

prepare() {
  cd $pkgname

  sed 's|import Image|from PIL import Image|g' -i $pkgname.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

